/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package factoryTotal;

import Config.ArchivoConfiguracion;
import Config.Configuracion;
import newMenu.ManagerPerfil;
import newMenu.ManagerRecursos;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;


/**
 *
 * @author wida46984148
 */
public class FabricaNaves {

    private static ArchivoConfiguracion NaveWida;
    private static ArchivoConfiguracion NaveEnemiga;
    private int nivelEnemigo = ManagerPerfil.getLevel();

    public static NaveBase naveWida(String ref) throws SlickException {
        NaveBase nb = null;
        if (NaveWida == null) {
            NaveWida = Configuracion.getUnidades();
        }
        if (ref.equals("nave1")) {
            Image img = ManagerRecursos.getImage("nave1Me109Image");//new Image("src/data/plane.png");
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image bm = new Image("src/data/bomb.png");
            Image stLE = ManagerRecursos.getImage("naveWidaExplosionBombaImage");//new Image("src/data/expL.png");
            nb = new NaveWida(15, 15, ManagerPerfil.getVidas(), new DisparoWida(4, st), new DisparoBomba(30, bm,stLE), img, exp);
        } else if (ref.equals("nave2")) {
            Image bm = new Image("src/data/bomb.png");
            Image img = ManagerRecursos.getImage("nave1BearcatImage");//new Image("src/data/plane.png");
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image stLE = ManagerRecursos.getImage("naveWidaExplosionBombaImage");//new Image("src/data/expL.png");
            nb = new NaveWida(27, 27, ManagerPerfil.getVidas(), new DisparoWida(5, st), new DisparoBomba(30, bm,stLE), img, exp);

        } else if (ref.equals("nave3")) {
            Image bm = new Image("src/data/bomb.png");
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot2.png");
            Image img = ManagerRecursos.getImage("nave1SpitefireImage");//new Image("src/data/planeW.png");
            Image stLE = ManagerRecursos.getImage("naveWidaExplosionBombaImage");//new Image("src/data/expL.png");
            nb = new NaveWida(30, 30, ManagerPerfil.getVidas(), new DisparoWida(3, st), new DisparoBomba(30, bm,stLE), img, exp);
        }
        return nb;
    }

    public static NaveBase navesEnemigas(String ref) throws SlickException {
        //System.out.println(nivelEnemigo);
        NaveBase nb = null;
        if (NaveEnemiga == null) {
            NaveEnemiga = Configuracion.getUnidades();
        }
        if (ref.equals("nave0")) {
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(15, 15, new DisparoCentro(2, st), img, -17, -99, exp);
        } else if (ref.equals("nave0A")) {
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(15, 15, new DisparoCentro(2, st), img, 100, -99, exp);
        } else if (ref.equals("nave0B")) {
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(15, 15, new DisparoCentro(2, st), img, 236, -99, exp);
        } else if (ref.equals("nave0C")) {
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(15, 15, new DisparoCentro(2, st), img, 365, -99, exp);
        } else if (ref.equals("nave0D")) {
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(15, 15, new DisparoCentro(2, st), img, 485, -99, exp);
        } else if (ref.equals("nave0E")) {
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(15, 15, new DisparoCentro(2, st), img, 593, -99, exp);
        } else if (ref.equals("nave0F")) {
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(15, 15, new DisparoCentro(2, st), img, 695, -99, exp);
        } else if (ref.equals("nave1")) {
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotTankImage");//new Image("src/data/shootTnk.gif");
            Image img = ManagerRecursos.getImage("tankImage");//new Image("src/data/tank.gif");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga2(25, 25, new DisparoIzquierda(4, st), new DisparoDerecha(4, st), img, (int) (Math.random() * 750 + 1), -99, exp);
        } else if (ref.equals("nave2A")) {
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotTankImage");//new Image("src/data/shootTnk.gif");
            Image img = ManagerRecursos.getImage("helicopteroImage");//new Image("src/data/heli.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga3(20, 20, new DisparoIzquierda(3, st), new DisparoDerecha(3, st), new DisparoCentro(3, st), img, 300, -99, exp);
        } else if (ref.equals("nave2B")) {
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotTankImage");//new Image("src/data/shootTnk.gif");
            Image img = ManagerRecursos.getImage("helicopteroImage");//new Image("src/data/heli.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga3(20, 20, new DisparoIzquierda(3, st), new DisparoDerecha(3, st), new DisparoCentro(3, st), img, 600, -99, exp);
        } else if (ref.equals("boss1")) {
            Image stL = ManagerRecursos.getImage("shotLaserBossImage");//new Image("src/data/laser.png");
            Image stLE = ManagerRecursos.getImage("explosionLaserImage");//new Image("src/data/expL.png");
            Image exp = ManagerRecursos.getImage("explosionBossImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotTankImage");//new Image("src/data/shootTnk.gif");
            Image img = ManagerRecursos.getImage("boss1Image");//new Image("src/data/boss1.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveBoss(100, 100, new DisparoCentro(2, st), new DisparoIzquierda(2, st), new DisparoDerecha(2, st), new DisparoLaser(7, stL, stLE), img, 200, -499, exp);
        }
        return nb;



    }
    /*
    public static NaveBase naveWida(String ref) throws SlickException{
        NaveBase nb = null;
        if (NaveWida == null) {
            NaveWida = Configuracion.getUnidades();
        }
        if (ref.equals("nave1")){
            Image img = ManagerRecursos.getImage("nave1Me109Image");//new Image("src/data/plane.png");
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");

            nb = new NaveWida(30, 30, ManagerPerfil.getVidas(), new DisparoWida(2, st), img, exp);
            
        }else if (ref.equals("nave2")){
            Image img = ManagerRecursos.getImage("nave1BearcatImage");//new Image("src/data/plane.png");
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");

            nb = new NaveWida(30, 30, ManagerPerfil.getVidas(), new DisparoWida(2, st), img, exp);

        }else if(ref.equals("nave3")){
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot2.png");
            Image img = ManagerRecursos.getImage("nave1SpitefireImage");//new Image("src/data/planeW.png");

            nb = new NaveWida(30, 30, ManagerPerfil.getVidas(), new DisparoWida(2, st), img,  exp);
        }
        return nb;
    }

    public static NaveBase navesEnemigas(String ref) throws SlickException{
        NaveBase nb = null;
        if (NaveEnemiga == null) {
            NaveEnemiga = Configuracion.getUnidades();
        }
        if (ref.equals("nave0")){
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(5, 5, new DisparoCentro(1, st), img, -17, -99, exp);
        } else if (ref.equals("nave0A")){
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(5, 5, new DisparoCentro(1, st), img, 100, -99, exp);
        } else if (ref.equals("nave0B")){
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(5, 5, new DisparoCentro(1, st), img, 236, -99, exp);
        } else if (ref.equals("nave0C")){
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(5, 5, new DisparoCentro(1, st), img, 365, -99, exp);
        } else if (ref.equals("nave0D")){
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(5, 5, new DisparoCentro(1, st), img, 485, -99, exp);
        } else if (ref.equals("nave0E")){
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(5, 5, new DisparoCentro(1, st), img, 593, -99, exp);
        } else if (ref.equals("nave0F")){
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotImage");//new Image("src/data/shot.jpg");
            Image img = ManagerRecursos.getImage("naveMe163Image");//new Image("src/data/planeE0.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga1(5, 5, new DisparoCentro(1, st), img, 695, -99, exp);
        } else if (ref.equals("nave1")){
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotTankImage");//new Image("src/data/shootTnk.gif");
            Image img = ManagerRecursos.getImage("tankImage");//new Image("src/data/tank.gif");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga2(10, 10, new DisparoIzquierda(1, st),new DisparoDerecha(1, st), img, (int)(Math.random()*750+1), -99, exp);
        } else if (ref.equals("nave2A")){
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotTankImage");//new Image("src/data/shootTnk.gif");
            Image img = ManagerRecursos.getImage("helicopteroImage");//new Image("src/data/heli.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga3(20, 20, new DisparoIzquierda(1, st),new DisparoDerecha(1, st),new DisparoCentro(1, st), img, 300, -99, exp);
        } else if (ref.equals("nave2B")){
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotTankImage");//new Image("src/data/shootTnk.gif");
            Image img = ManagerRecursos.getImage("helicopteroImage");//new Image("src/data/heli.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveEnemiga3(20, 20, new DisparoIzquierda(1, st),new DisparoDerecha(1, st),new DisparoCentro(1, st), img, 600, -99, exp);
        } else if( ref.equals("boss1")){
            Image stL = ManagerRecursos.getImage("shotTankImage");//new Image("src/data/laser.png");
            Image stLE = ManagerRecursos.getImage("shotTankImage");//new Image("src/data/expL.png");
            Image exp = ManagerRecursos.getImage("explosionImage");//new Image("src/data/explosion.jpg");
            Image st = ManagerRecursos.getImage("shotTankImage");//new Image("src/data/shootTnk.gif");
            Image img = ManagerRecursos.getImage("boss1Image");//new Image("src/data/boss1.png");
            //nb = new NaveEnemiga1(10, 10, null, img, 150, -100, exp);
            nb = new NaveBoss(20, 20, new DisparoCentro(2, st), new DisparoIzquierda(2, st),new DisparoDerecha(2, st), new DisparoLaser(7, stL,stLE), img, 200, -499, exp);
        }
        return nb;



    }*/

}